# Copyright (C) 2006, 2007  Stephane Alnet
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
# 

#
# For more information visit http://carrierclass.net/
#

use strict;
use warnings;

package CCNProxy::Model::LineNumber;

use Jifty::DBI::Schema;

use CCNCore::Record schema {

    # On-Net call routing
    column number =>        # "DID" -- Request username
        type is 'text',
        is mandatory,
        since '0.0.1',
        label is 'Number',
        hints is 'The full inbound number, in "1"+10 digits format.'
    ;

    # Used to populate $avp(numuser) -- key=number, value=customer->username
    column customer =>
        references CCNProxy::Model::Customer,
        is mandatory,
        since '0.0.1',
        label is 'Customer',
        hints is ''
    ;

    # Use cfa_uri or cfnr_uri to implement "route to a trunk".
    column cfa_uri =>
        type is 'text',
        since '0.0.1',
        label is 'CFA URI',
        hints is 'The URI to dial for all calls to this number.'
    ;
    
    column cfnr_uri =>
        type is 'text',
        since '0.0.1',
        label is 'CFNR URI',
        hints is 'The URI to dial if this number is not registered.'
    ;
    
    column cfb_uri =>
        type is 'text',
        since '0.0.1',
        label is 'CFB URI',
        hints is 'The URI to dial if this number is busy.'
    ;
    
    column cfda_uri =>
        type is 'text',
        since '0.0.1',
        label is 'CFDA URI',
        hints is 'The URI to call if this number does not answer.'
    ;
  
};

use CCNCore::Mixin::Active;
use CCNCore::Mixin::FancyName;

sub since { 0.0.1 }
sub menu { 'User side' }

1;